package com.eric.domain.dto;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Validated
public class WarehouseLayoutDTO {

    private Integer id;

    @NotBlank(message = "编号不能为空")
    @Pattern(regexp = "^[0-9]{1,10}$", message = "编号必须是1-10位数字")
    private String containerNumber;

    @NotBlank(message = "储物类型不能为空")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5a-zA-Z0-9]+$", message = "可以有中文、数字、英文但不能有特殊符号")
    private String containerName;

    @NotBlank(message = "父节点不能为空")
    @Pattern(regexp = "^[0-9]+$", message = "父节点必须是数字")
    private Integer pid;

    private String description;


}
